import type { GiteePositoryVO, GiteePositoryForm, GiteePositoryQuery } from './model';

import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';

import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';

/**
* 查询Gitee仓库地址列表
* @param params
* @returns Gitee仓库地址列表
*/
export function giteePositoryList(params?: GiteePositoryQuery) {
  return requestClient.get<PageResult<GiteePositoryVO>>('/bwflwp/giteePository/list', { params });
}

/**
 * 导出Gitee仓库地址列表
 * @param params
 * @returns Gitee仓库地址列表
 */
export function giteePositoryExport(params?: GiteePositoryQuery) {
  return commonExport('/bwflwp/giteePository/export', params ?? {});
}

/**
 * 查询Gitee仓库地址详情
 * @param id id
 * @returns Gitee仓库地址详情
 */
export function giteePositoryInfo(id: ID) {
  return requestClient.get<GiteePositoryVO>(`/bwflwp/giteePository/${id}`);
}

/**
 * 新增Gitee仓库地址
 * @param data
 * @returns void
 */
export function giteePositoryAdd(data: GiteePositoryForm) {
  return requestClient.postWithMsg<void>('/bwflwp/giteePository', data);
}

/**
 * 更新Gitee仓库地址
 * @param data
 * @returns void
 */
export function giteePositoryUpdate(data: GiteePositoryForm) {
  return requestClient.putWithMsg<void>('/bwflwp/giteePository', data);
}

/**
 * 删除Gitee仓库地址
 * @param id id
 * @returns void
 */
export function giteePositoryasync() {
  return requestClient.get<void>(`/bwflwp/giteePository/async`);
}

/**
 * ton
 * @param id id
 * @returns void
 */
export function giteePositoryRemove(id: ID | IDS) {
  return requestClient.deleteWithMsg<void>(`/bwflwp/giteePository/${id}`);
}
